﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Runtime.Remoting.Messaging;
using System.Text;
using System.Threading.Tasks;
using TiTi.tea.Model;

namespace TiTi.tea.DAL
{
    public class DbContextFactory
    {
        public static DbContext Create()
        {
            DbContext ctx = CallContext.GetData("DbContext") as DbContext;

            if (ctx == null)
            {
                ctx = new TiTiContext();
                //ctx = new MyWMSEntities();
                //ctx.Configuration.ProxyCreationEnabled = false;
                //ctx.Configuration.LazyLoadingEnabled = false;
                CallContext.SetData("DbContext", ctx);
            }
            return ctx;
        }
    }
}
